bitkeeper revision 1.1240 (4224726fJ1qampcdzMTCSrPkcOif_w)
authorrneugeba@wyvis.research.intel-research.net <rneugeba@wyvis.research.intel-research.net>
Tue, 1 Mar 2005 13:47:27 +0000 (13:47 +0000)
committerrneugeba@wyvis.research.intel-research.net <rneugeba@wyvis.research.intel-research.net>
Tue, 1 Mar 2005 13:47:27 +0000 (13:47 +0000)
minor tweak

Signed-off-by: michael.fetterman@cl.cam.ac.uk
xen/arch/x86/mm.c
xen/arch/x86/x86_32/asm-offsets.c

index 1f577e98c012132979339232a66f23e776eebf4f..a8c72861ffb891eda73d67a22529421ed474a1f4 100644 (file)
@@ -1689,10 +1689,8 @@ int do_mmu_update(
     perfc_incrc(calls_to_mmu_update); 
     perfc_addc(num_page_updates, count);
     /*
-     * do a histogram for count. 
-     * first bucket is for count=0,
-     * second bucket is for count=1
-     * last bucket is for count >= 63 *  PERFC_PT_UPDATES_BUCKET_SIZE
+     * histogram: special treatment for 0 and 1 count. After that equally
+     * spaced with last bucket taking the rest.
      */
     if ( count == 0 )
     {
@@ -1700,10 +1698,10 @@ int do_mmu_update(
     } else if ( count == 1 )
     {
         perfc_incra(bpt_updates, 1);
-    } else if ( (count / PERFC_PT_UPDATES_BUCKET_SIZE)
+    } else if ( ((count-2) / PERFC_PT_UPDATES_BUCKET_SIZE)
                 < (PERFC_MAX_PT_UPDATES - 3) )
     {
-        perfc_incra(bpt_updates, (count / PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
+        perfc_incra(bpt_updates, ((count-2)/PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
     } else
     {
         perfc_incra(bpt_updates, PERFC_MAX_PT_UPDATES - 1);
@@ -2371,10 +2369,8 @@ void ptwr_flush(const int which)
 
 #ifdef PERF_COUNTERS
     /*
-     * do a histogram for count. 
-     * first bucket is for count=0,
-     * second bucket is for count=1
-     * last bucket is for count >= 63 *  PERFC_PT_UPDATES_BUCKET_SIZE
+     * histogram: special treatment for 0 and 1 count. After that equally
+     * spaced with last bucket taking the rest.
      */
     if ( count == 0 )
     {
@@ -2382,10 +2378,10 @@ void ptwr_flush(const int which)
     } else if ( count == 1 ) 
     {
         perfc_incra(wpt_updates, 1);
-    } else if ( (count / PERFC_PT_UPDATES_BUCKET_SIZE)
+    } else if ( ((count-2) / PERFC_PT_UPDATES_BUCKET_SIZE)
                 < (PERFC_MAX_PT_UPDATES - 3) )
     {
-        perfc_incra(wpt_updates, (count / PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
+        perfc_incra(wpt_updates, ((count-2)/PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
     } else
     {
         perfc_incra(wpt_updates, PERFC_MAX_PT_UPDATES - 1);
index 4a609826a1e6801d8c7ef7dda962667ecacbd5bf..a91692e3c607f22e732be1a9c480fd70cc84fe90 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <xen/sched.h>
+#include <xen/config.h>
 
 #define DEFINE(_sym, _val) \
     __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
@@ -69,6 +70,8 @@ void __dummy__(void)
 
     DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
 
-    OFFSET(PERFC_hypercalls, struct perfcounter_t, hypercalls);
-    OFFSET(PERFC_exceptions, struct perfcounter_t, exceptions);
+#if PERF_COUNTERS
+    OFFSET(PERFC_hypercalls, struct perfcounter, hypercalls);
+    OFFSET(PERFC_exceptions, struct perfcounter, exceptions);
+#endif
 }